package com.showcase.cloud.gateway.config;

import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.IPing;
import com.netflix.loadbalancer.PingUrl;
import com.sun.showcase.utils.JwtTokenUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.client.RestTemplate;

@Configuration
public class MainConfig {

    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
    @Bean
    public IPing ribbonPing(){

        return new HealthExamination(restTemplate());
        //return new PingUrl(false,"/demo/health");
    }
    @Bean
    public JwtTokenUtil jwtTokenUtil() {
        return new JwtTokenUtil();
    }
//    public IPing healthExamination(IClientConfig config){
//        return new HealthExamination(config);
//    }

//    @Bean
//    public IPing ribbonPing() {
//        return new PingUrl(false,"/demo/health");
//    }
}
